﻿using PaletteSharp;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks; 

namespace ClassLibrary2
{
    public class BitmapHelper
    {
        public static Color DominantColor(string path)
        {
            Bitmap showBitmap = (Bitmap)Bitmap.FromFile(path, false); 
            PaletteBuilder pb = new PaletteBuilder(showBitmap);
            Palette palette = pb.Generate(); 
            var color = palette.GetDominantColor(Color.White);
            showBitmap.Dispose();
            return color;
        }
    }
}
